# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=qca
pkgver=2.3.1
pkgrel=0
pkgdesc="Qt cryptographic architecture"
url="https://userbase.kde.org/QCA"
arch="all"
license="LGPL-2.1-or-later"
makedepends="qt5-qtbase-dev cmake cyrus-sasl-dev"
subpackages="$pkgname-dev $pkgname-doc lib$pkgname:libs"
source="https://download.kde.org/stable/qca/$pkgver/qca-$pkgver.tar.xz"

build() {
	cmake -B build . \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DWITH_cyrus-sasl_PLUGIN=yes
	make -C build
}

check() {
	make -C build test
}

package() {
	make -C build DESTDIR="$pkgdir" install
	mkdir -p "$pkgdir"/usr/lib/qt5
	mv "$pkgdir"/usr/mkspecs "$pkgdir"/usr/lib/qt5
}

libs() {
	default_libs
	mv "$pkgdir"/usr/lib/qca-qt5 "$subpkgdir"/usr/lib
}

sha512sums="092704a8d7c5973f05c82584ea55b4f8f874965aea943277e50fde873913a9bdad6a51ea74fc0036bbb632a13141cb4c030504229c06779890286205929f6021  qca-2.3.1.tar.xz"
